package com.taotao.web.controller;

import java.io.IOException;

import org.apache.http.client.ClientProtocolException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.taotao.web.service.IndexService;

@Controller
public class PageController {
	
	@Autowired
	private IndexService indexService;

	@RequestMapping("index")
	public ModelAndView toPage() throws ClientProtocolException, IOException{
		ModelAndView mv = new ModelAndView("index");
	    String jsonAD1 = this.indexService.queryAD1();
		mv.addObject("AD1", jsonAD1);
		String jsonAD2 = this.indexService.queryAD2();
		mv.addObject("AD2", jsonAD2);
		return mv;
	}
	
	
	
	
	
}

